<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;

/* @var $this yii\web\View */
/* @var $model app\modules\admin\models\User */
/* @var $form yii\widgets\ActiveForm */
$menus = ArrayHelper::map($menus,'menu_id','menu_label');
$menus = ArrayHelper::merge([0=>'最上级分类'],$menus);
?>

<div class="user-form">

    <?php $form = ActiveForm::begin(['enableAjaxValidation' => true]); ?>

    <?= $form->field($menu, 'menu_label')->textInput() ?>

    <?= $form->field($menu, 'menu_icon')->textInput() ?>

    <?= $form->field($menu, 'menu_module_id')->textInput() ?>

    <?= $form->field($menu, 'menu_controller_id')->textInput() ?>

    <?= $form->field($menu, 'menu_action_id')->textInput() ?>

    <?= $form->field($menu, 'menu_is_visible')->dropDownList([0=>'不可见',1=>'可见']) ?>

    <?= $form->field($menu, 'menu_is_lowest')->dropDownList([0=>'不是',1=>'是']) ?>

    <?= $form->field($menu, 'menu_parent_id')->dropDownList($menus) ?>

    <div class="form-group">
        <?= Html::submitButton($menu->isNewRecord ? 'Create' : 'Update', ['class' => $menu->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
